-
Notifications
You must be signed in to change notification settings - Fork 5.7k
feat: Add GitLab Duo Agentic Chat Provider Support #7333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
|
Related PR to models.dev registry: anomalyco/models.dev#616 |
|
/review |
|
/review |
|
Closes #7455 |
|
I am not sure why PR Standards check is failing. I've created an issue and linked it to this PR. |
|
@vglafirov apologies for delay I had this open on my computer but forgot to look at it |
|
@rekram1-node You recently merged Gitlab Duo PR on models.dev, but deployment pipeline is failing. If we get models deployed on models.dev, I can remove models from https://github.com/anomalyco/opencode/pull/7333/changes#diff-b0155a9e5561043f50ba86bc54d5fd59aa528c7af7c92b2f37585d80e792cd9aR740 PR to fix deployment issues: anomalyco/models.dev#631 |
|
@vglafirov I merged pr thx for callout |
packages/opencode/package.json
Outdated
| "@gitlab/opencode-gitlab-auth": "1.2.1", | ||
| "@gitlab/opencode-gitlab-plugin": "1.0.6", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are these 2 added as deps if they arent imported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The @gitlab/opencode-gitlab-auth and @gitlab/opencode-gitlab-plugin packages are imported, but dynamically in the auto-loading logic at packages/opencode/src/plugin/index.ts. They're loaded conditionally when GitLab is configured:
if (shouldLoadGitLabPlugins && !Flag.OPENCODE_DISABLE_DEFAULT_PLUGINS) {
log.info("auto-loading GitLab plugins")
plugins.push("@gitlab/opencode-gitlab-auth@latest")
plugins.push("@gitlab/opencode-gitlab-plugin@latest")
}Since they're dynamically imported rather than statically at the top of the file, they need to be in dependencies (not devDependencies) for runtime availability
|
Can you link me to these packages you are adding? for some reason they aren't popping up when I try to search for them but that is likely me being an idiot |
|
Just address these and I will merge tmr morn! Once again sorry for delays our issue and pr volume has exploded Feel free to DM or email me if needed |
You are not an idiot. I have no idea why, but they are not popping up in a search, for some reason 😞 Here they are: |
|
@vglafirov this is awesome — thanks for building it! |
@kamilchm This PR contains documentation update: https://github.com/anomalyco/opencode/pull/7333/changes#diff-b5d5affc6941bf7bb19805cc8f556cd1b9ae73ffd99e520120700536b166f8c0 Also check published npm packages in comment above. They providing extensive documentation how to use this integration. Feel free to provide a feedback here or on repositories behind these npm packages. We haven't tested this on self-hosted instances yet, I am highly interesting to see if it works as expected. Thanks |
|
Great, one more question: do I need snything special on the GitLab Server side? Version, features? |
If you have self-hosted Duo, then I guess nothing special is needed, if not: https://docs.gitlab.com/administration/gitlab_duo_self_hosted/ |
@rekram1-node I've fixed npmjs search problems. It was due to poor metadata. Packages are searcheble now :) |
Add GitLab Duo Provider Support
Problem
In-line with GitLab's open-core strategy, we want to officially integrate GitLab Duo with OpenCode as a supported provider, operable with both GitLab.com and self-hosted GitLab instances. To streamline our users' journey across tools and enable access to GitLab's AI capabilities including agentic chat with native tool calling, GitLab is upstreaming the required provider packages to this repository.
Solution
This PR adds GitLab as a supported provider with three agentic chat model variants (Haiku, Sonnet, Opus), enabling seamless integration with GitLab.com and self-hosted instances.
Changes
Dependencies Added
@gitlab/[email protected]- Provider implementation@gitlab/[email protected]- OAuth/PAT authentication@gitlab/[email protected]- GitLab API toolsProvider Implementation
provider.tsGITLAB_INSTANCE_URLPlugin Auto-Loading
OPENCODE_DISABLE_DEFAULT_PLUGINSflagTests
Files Changed
packages/opencode/package.json- Added 3 GitLab dependenciespackages/opencode/src/provider/provider.ts- GitLab provider implementationpackages/opencode/src/plugin/index.ts- Auto-loading logicpackages/opencode/test/provider/gitlab-duo.test.ts- New tests (8 tests)packages/docs/essentials/gitlab-duo.mdx- DocumentationUsage
Basic setup with environment variable:
Then use in config:
{ "model": "gitlab/duo-chat-sonnet-4-5" }Self-hosted GitLab:
Testing
Closes #7455